package com.sxbbc.common.core.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.function.common.RestResponse;
import com.sxbbc.common.core.entity.jz.BBusiness;
import com.sxbbc.common.core.utils.BasePage;

/**
 * <p>
 * 店铺信息表 服务类
 * </p>
 *
 * @author leehao
 * @since 2019-05-08
 */
public interface BBusinessService extends IService<BBusiness> {

    /**
     * 商家列表页
     * @param page 分页条件
     * @param business 查询条件
     * @author leehao
     * @return com.baomidou.mybatisplus.plugins.Page<com.sxbbc.common.core.entity.jz.BBusiness>
     */
    Page<BBusiness> queryBusinessList(BasePage<BBusiness> page, BBusiness business);

    /**
     * 新增商家 新增成功后增加商家端管理员
     * @param business 商家对象
     * @author leehao
     * @return 成功失败状态值
     */
    RestResponse addBusiness(BBusiness business);
    


    /**
     * api申请商家入驻 首次申请
     * @param business 商家对象
     * @author leehao
     * @return com.function.common.RestResponse
     */
    RestResponse addBusinessForApi(BBusiness business);

    /**
     * 重置商家密码
     * @param id 商家id
     * @param type 1登录密码 要更改BLogin对象
     *             2交易密码
     * @author leehao
     * @return com.function.common.RestResponse
     */
    RestResponse handleResetBusinessPassword(Integer id, Integer type);

    /**
     * 当商家是平台新增
     * 或申请入驻后，平台审核通过
     * @param business 商家对象
     * @author leehao
     * @return com.function.common.RestResponse
     */
    RestResponse handleApplySuccessAddBLogin(BBusiness business);

    /**
     * 通过商家编码查询商家
     * @param businessCode 商家编码
     * @author leehao
     * @return com.sxbbc.common.core.entity.jz.BBusiness
     */
    BBusiness selectByBusinessCode(String businessCode);

    /**
     * 编辑商家
     * @param business 商家对象
     * @author leehao
     * @return com.function.common.RestResponse
     */
    RestResponse editBusiness(BBusiness business);

    /**
     * api重新申请 或者申请另一店铺范围
     * @param business 申请入驻资料
     * @author leehao
     * @return com.function.common.RestResponse
     */
    RestResponse editBusinessForApi(BBusiness business);
}